package com.tuozixuan.demo;

import reactor.core.publisher.Flux;

import java.util.function.Consumer;

public class BaseSubscribeDemo2 {

    public static void main(String[] args) {
        Flux.just("java", "python", "golang").doOnNext(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println("Hello " + s + "!");
            }
        }).doOnComplete(new Runnable() {
            @Override
            public void run() {
                System.out.println("Completed");
            }
       }).subscribe();
    }
}
